package com.jinlejia.feedback;

import androidx.multidex.MultiDexApplication;

import com.jinlejia.erp.base.NetInterceptor;
import com.jinlejia.erp.base.TokenInterceptor;
import com.zhy.http.okhttp.OkHttpUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;


public class FbApplication extends MultiDexApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        HttpLoggingInterceptor log = new HttpLoggingInterceptor();
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .connectTimeout(60000L, TimeUnit.MILLISECONDS)
                .readTimeout(60000L, TimeUnit.MILLISECONDS)
                .addInterceptor(log)
//                .addInterceptor(new MockInterceptor(this))
                .addInterceptor(new TokenInterceptor(this))
                .addInterceptor(new NetInterceptor(this))
                .build();
        OkHttpUtils.initClient(okHttpClient);
    }
}
